Skip to content

Finish adding OSGi support#8417

Merged
jack-berg merged 7 commits into
open-telemetry:mainfrom
jack-berg:osgi-autoconfigure
Jun 2, 2026
Merged

Finish adding OSGi support#8417
jack-berg merged 7 commits into
open-telemetry:mainfrom
jack-berg:osgi-autoconfigure

Conversation

@jack-berg
Copy link
Copy Markdown
Member

@jack-berg jack-berg commented May 20, 2026

Followup to #7964, #8401

Resolves #768

  • Add support for autoconfigure / declarative configuration, and corresponding OSGi tests
  • Add missing Provides-Capabilities metadata to all artifacts which provide SPI implementations
  • Add test asserting that every artifact's Provide-Capabilities from MANIFEST.mf matches the SPIs they advertise in resources/META-INF/services

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.02%. Comparing base (8ea776b) to head (c9b3f20).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8417      +/-   ##
============================================
+ Coverage     90.99%   91.02%   +0.03%     
- Complexity     7814     7818       +4     
============================================
  Files           892      893       +1     
  Lines         23718    23719       +1     
  Branches       2364     2364              
============================================
+ Hits          21582    21591       +9     
+ Misses         1416     1408       -8     
  Partials        720      720              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg jack-berg changed the title Add OSGi support for autoconfigure and declarative config Finish adding OSGi support May 20, 2026
@jack-berg jack-berg marked this pull request as ready for review May 20, 2026 20:36
@jack-berg jack-berg requested a review from a team as a code owner May 20, 2026 20:36
@jack-berg
Copy link
Copy Markdown
Member Author

cc @royteeuwen this adds OSGi support for autoconfigure and declarative config

@github-actions github-actions Bot mentioned this pull request May 20, 2026
@royteeuwen
Copy link
Copy Markdown

@jack-berg nice! This seems to fix almost everything that I was missing in previous branch. The only thing debatable left is that io.opentelemetry.sdk.autoconfigure.spi* is still a mandatory import in exporter-common / exporter-otlp, so if you would want to set up opentelemetry only through the SDK, that's not possible yet.

@jack-berg
Copy link
Copy Markdown
Member Author

io.opentelemetry.sdk.autoconfigure.spi* is still a mandatory import in exporter-common / exporter-otlp, so if you would want to set up opentelemetry only through the SDK, that's not possible yet.

Ah yes that should be optional. I think that's an artifact of that module having an implementaiton dependency on the SPI module, instead of compileOnly. Will fix, and look for similar other cases.

@royteeuwen
Copy link
Copy Markdown

royteeuwen commented May 23, 2026

Super, thanks for the effort @jack-berg :). Any idea when this would typically make it into release? Then I can update my frameworks to the native versions and archive my osgi wrappers 😄?

Sorry, edit: Archiving my OSGi wrappers would only work if also the opentelemetry-java-instrumentation and the semconv would be OSGi-enabled. Any plans to also make a PR there :)?

This was referenced May 26, 2026
@jack-berg
Copy link
Copy Markdown
Member Author

Sorry, edit: Archiving my OSGi wrappers would only work if also the opentelemetry-java-instrumentation and the semconv would be OSGi-enabled. Any plans to also make a PR there :)?

I think those are whole different questions! Semconv seems easy enough since its just two packages dependent on opentelemetry-api. Instrumentation seems like a bigger story because it has many many packages, its own SPIs, and of course the javaagent which isn't meant to be consumed like a normal library. Also, it has different maintainers with different priorities. So new set of questions to answer.

I recommend we open new issues in those respective repos and go from there.

@jack-berg jack-berg merged commit 9ab2f57 into open-telemetry:main Jun 2, 2026
45 of 47 checks passed
@jack-berg
Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OSGi support for API and SDK

3 participants